# DID Document Metadata

from typing import Optional
from pydantic import BaseModel

# https://www.w3.org/TR/did-core/#did-document-metadata


class DIDDocumentMetaData(BaseModel):
    created: Optional[str]
    updated: Optional[str]
    deactivated: Optional[str]
    nextUpdate: Optional[str]
    versionId: Optional[str]
    nextVersionId: Optional[str]
    equivalentId: Optional[list[str]]
    canonicalId: Optional[str]


# https://www.w3.org/TR/did-core/#did-resolution-metadata
class DIDResolutionMetadata(BaseModel):
    contentType: Optional[str]
    error: Optional[str]  # invalidDid/notFound/representationNotSupported


# https://www.w3.org/TR/did-core/#did-url-dereferencing
class DIDUrlDereferencing:
    didUrl: Optional[str]
    # a map of properties. Each property name MUST be a string.
    # Each property value MUST be a string, map, list, set, boolean, or null.
    dereferencingOptions: Optional[object]
    dereferencingMetadata: Optional[object]
    contentStream: Optional[object]
    contentMetadata: Optional[object]

# https://www.w3.org/TR/did-core/#did-url-dereferencing-metadata
# https://www.w3.org/TR/did-core/#bib-did-spec-registries


class DIDUrlDereferencingMetadata(BaseModel):
    contentType: Optional[str]
    error: Optional[str]  # invalidDidUrl/notFound
